#include <hxcpp.h>

#ifndef INCLUDED_Date
#include <Date.h>
#endif
#ifndef INCLUDED_Std
#include <Std.h>
#endif
#ifndef INCLUDED_jax_io_JFile
#include <jax/io/JFile.h>
#endif
#ifndef INCLUDED_sys_FileSystem
#include <sys/FileSystem.h>
#endif
#ifndef INCLUDED_sys_io_File
#include <sys/io/File.h>
#endif
namespace jax{
namespace io{

Void JFile_obj::__construct(Dynamic f,Dynamic s)
{
{
	HX_SOURCE_POS("Source/jax/io/JFile.hx",13)
	if (((bool(::Std_obj::is(f,hx::ClassOf< ::String >())) && bool((s == null()))))){
		HX_SOURCE_POS("Source/jax/io/JFile.hx",14)
		if ((::sys::FileSystem_obj::exists(f))){
			HX_SOURCE_POS("Source/jax/io/JFile.hx",17)
			this->path = ::sys::FileSystem_obj::fullPath(f);
		}
		else{
			HX_SOURCE_POS("Source/jax/io/JFile.hx",20)
			this->path = f;
		}
	}
}
;
	return null();
}

JFile_obj::~JFile_obj() { }

Dynamic JFile_obj::__CreateEmpty() { return  new JFile_obj; }
hx::ObjectPtr< JFile_obj > JFile_obj::__new(Dynamic f,Dynamic s)
{  hx::ObjectPtr< JFile_obj > result = new JFile_obj();
	result->__construct(f,s);
	return result;}

Dynamic JFile_obj::__Create(hx::DynamicArray inArgs)
{  hx::ObjectPtr< JFile_obj > result = new JFile_obj();
	result->__construct(inArgs[0],inArgs[1]);
	return result;}

bool JFile_obj::exists( ){
	HX_SOURCE_PUSH("JFile_obj::exists")
	HX_SOURCE_POS("Source/jax/io/JFile.hx",23)
	return ::sys::FileSystem_obj::exists(this->path);
}


HX_DEFINE_DYNAMIC_FUNC0(JFile_obj,exists,return )

bool JFile_obj::isDirectory( ){
	HX_SOURCE_PUSH("JFile_obj::isDirectory")
	HX_SOURCE_POS("Source/jax/io/JFile.hx",30)
	return ::sys::FileSystem_obj::isDirectory(this->path);
}


HX_DEFINE_DYNAMIC_FUNC0(JFile_obj,isDirectory,return )

Void JFile_obj::createNewFile( ){
{
		HX_SOURCE_PUSH("JFile_obj::createNewFile")
		HX_SOURCE_POS("Source/jax/io/JFile.hx",37)
		::sys::io::File_obj::saveContent(this->path,HX_CSTRING(""));
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC0(JFile_obj,createNewFile,(void))

::String JFile_obj::getAbsolutePath( ){
	HX_SOURCE_PUSH("JFile_obj::getAbsolutePath")
	HX_SOURCE_POS("Source/jax/io/JFile.hx",42)
	return ::sys::FileSystem_obj::fullPath(this->path);
}


HX_DEFINE_DYNAMIC_FUNC0(JFile_obj,getAbsolutePath,return )

Float JFile_obj::lastModified( ){
	HX_SOURCE_PUSH("JFile_obj::lastModified")
	HX_SOURCE_POS("Source/jax/io/JFile.hx",49)
	return ::sys::FileSystem_obj::stat(this->path)->__Field(HX_CSTRING("mtime"),true)->__Field(HX_CSTRING("getTime"),true)();
}


HX_DEFINE_DYNAMIC_FUNC0(JFile_obj,lastModified,return )


JFile_obj::JFile_obj()
{
}

void JFile_obj::__Mark(HX_MARK_PARAMS)
{
	HX_MARK_BEGIN_CLASS(JFile);
	HX_MARK_MEMBER_NAME(path,"path");
	HX_MARK_END_CLASS();
}

void JFile_obj::__Visit(HX_VISIT_PARAMS)
{
	HX_VISIT_MEMBER_NAME(path,"path");
}

Dynamic JFile_obj::__Field(const ::String &inName,bool inCallProp)
{
	switch(inName.length) {
	case 4:
		if (HX_FIELD_EQ(inName,"path") ) { return path; }
		break;
	case 6:
		if (HX_FIELD_EQ(inName,"exists") ) { return exists_dyn(); }
		break;
	case 11:
		if (HX_FIELD_EQ(inName,"isDirectory") ) { return isDirectory_dyn(); }
		break;
	case 12:
		if (HX_FIELD_EQ(inName,"lastModified") ) { return lastModified_dyn(); }
		break;
	case 13:
		if (HX_FIELD_EQ(inName,"createNewFile") ) { return createNewFile_dyn(); }
		break;
	case 15:
		if (HX_FIELD_EQ(inName,"getAbsolutePath") ) { return getAbsolutePath_dyn(); }
	}
	return super::__Field(inName,inCallProp);
}

Dynamic JFile_obj::__SetField(const ::String &inName,const Dynamic &inValue,bool inCallProp)
{
	switch(inName.length) {
	case 4:
		if (HX_FIELD_EQ(inName,"path") ) { path=inValue.Cast< ::String >(); return inValue; }
	}
	return super::__SetField(inName,inValue,inCallProp);
}

void JFile_obj::__GetFields(Array< ::String> &outFields)
{
	outFields->push(HX_CSTRING("path"));
	super::__GetFields(outFields);
};

static ::String sStaticFields[] = {
	String(null()) };

static ::String sMemberFields[] = {
	HX_CSTRING("path"),
	HX_CSTRING("exists"),
	HX_CSTRING("isDirectory"),
	HX_CSTRING("createNewFile"),
	HX_CSTRING("getAbsolutePath"),
	HX_CSTRING("lastModified"),
	String(null()) };

static void sMarkStatics(HX_MARK_PARAMS) {
};

static void sVisitStatics(HX_VISIT_PARAMS) {
	HX_VISIT_MEMBER_NAME(JFile_obj::__mClass,"__mClass");
};

Class JFile_obj::__mClass;

void JFile_obj::__register()
{
	Static(__mClass) = hx::RegisterClass(HX_CSTRING("jax.io.JFile"), hx::TCanCast< JFile_obj> ,sStaticFields,sMemberFields,
	&__CreateEmpty, &__Create,
	&super::__SGetClass(), 0, sMarkStatics, sVisitStatics);
}

void JFile_obj::__boot()
{
}

} // end namespace jax
} // end namespace io
